package com.example.producer.controller;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class TestController {

    @Resource
    private RocketMQTemplate rocketMQTemplate;

    @GetMapping("/send1")
    public String send1() {
        rocketMQTemplate.convertAndSend("first-topic","hello,world" );
        return "发送成功";
    }

}
